package com.cms.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/*
 * 文章分类
 */
@Entity
@Table(name = "t_Article_Type")
public class ArticleType implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -9034663639302842095L;
	/*
	 * 数据库ID
	 */
	@Id
	@GeneratedValue(strategy =GenerationType.AUTO)
	private int id;
	/*
	 * 文章分类名称
	 */
	@Column
	private String name;
	/*
	 * 分类下面的所有文�?
	 */
	@OneToMany(mappedBy = "type")
	private List<Article> articles = new ArrayList<Article>();
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public List<Article> getArticles() {
		return articles;
	}
	public void setArticles(List<Article> articles) {
		this.articles = articles;
	}
	
	
}
